*****************************************************************************
* 																			*
*			Campaign Panel Book Chapter 4 - Intraindividual Dynamic Party Choice crossed with Evaluation Scale*		
*																			*
*****************************************************************************

*Types of campaign dynamics of party choice

*2009
gen a_cdu_typ = .
replace a_cdu_typ = 1 if a_lazarstyp_novote_cry==1 & a_wabsrestr_novote1_w2==1 & a_wabsrestr_novote7==1
replace a_cdu_typ = 2 if a_lazarstyp_novote_cry==2 & a_wabsrestr_novote7==1
replace a_cdu_typ = 3 if a_lazarstyp_novote_cry==4 & a_wabsrestr_novote7==1
replace a_cdu_typ = 4 if a_lazarstyp_novote_cry==4 & a_wabsrestr_novote1_w2==1

gen a_spd_typ = .
replace a_spd_typ = 1 if a_lazarstyp_novote_cry==1 & a_wabsrestr_novote1_w2==4 & a_wabsrestr_novote7==4
replace a_spd_typ = 2 if a_lazarstyp_novote_cry==2 & a_wabsrestr_novote7==4
replace a_spd_typ = 3 if a_lazarstyp_novote_cry==4 & a_wabsrestr_novote7==4
replace a_spd_typ = 4 if a_lazarstyp_novote_cry==4 & a_wabsrestr_novote1_w2==4

gen a_gru_typ = .
replace a_gru_typ = 1 if a_lazarstyp_novote_cry==1 & a_wabsrestr_novote1_w2==6 & a_wabsrestr_novote7==6
replace a_gru_typ = 2 if a_lazarstyp_novote_cry==2 & a_wabsrestr_novote7==6
replace a_gru_typ = 3 if a_lazarstyp_novote_cry==4 & a_wabsrestr_novote7==6
replace a_gru_typ = 4 if a_lazarstyp_novote_cry==4 & a_wabsrestr_novote1_w2==6

*2013
gen b_cdu_typ = .
replace b_cdu_typ = 1 if b_lazarstyp_novote_cry==1 & b_wabsrestr_novote1==1 & b_wabsrestr_novote7==1
replace b_cdu_typ = 2 if b_lazarstyp_novote_cry==2 & b_wabsrestr_novote7==1
replace b_cdu_typ = 3 if b_lazarstyp_novote_cry==4 & b_wabsrestr_novote7==1
replace b_cdu_typ = 4 if b_lazarstyp_novote_cry==4 & b_wabsrestr_novote1==1

gen b_spd_typ = .
replace b_spd_typ = 1 if b_lazarstyp_novote_cry==1 & b_wabsrestr_novote1==4 & b_wabsrestr_novote7==4
replace b_spd_typ = 2 if b_lazarstyp_novote_cry==2 & b_wabsrestr_novote7==4
replace b_spd_typ = 3 if b_lazarstyp_novote_cry==4 & b_wabsrestr_novote7==4
replace b_spd_typ = 4 if b_lazarstyp_novote_cry==4 & b_wabsrestr_novote1==4

gen b_gru_typ = .
replace b_gru_typ = 1 if b_lazarstyp_novote_cry==1 & b_wabsrestr_novote1==6 & b_wabsrestr_novote7==6
replace b_gru_typ = 2 if b_lazarstyp_novote_cry==2 & b_wabsrestr_novote7==6
replace b_gru_typ = 3 if b_lazarstyp_novote_cry==4 & b_wabsrestr_novote7==6
replace b_gru_typ = 4 if b_lazarstyp_novote_cry==4 & b_wabsrestr_novote1==6


********************************************************************************
***Tables 41 and 42
********************************************************************************

*Evaluation scale Merkel
*** 09
bysort a_cdu_typ: tab a_skal_merkel_hd_ges a_rohkoeffkat_skal_merkel [aw=a_weight], cell

bysort a_spd_typ: tab a_skal_merkel_hd_ges a_rohkoeffkat_skal_merkel [aw=a_weight], cell

bysort a_gru_typ: tab a_skal_merkel_hd_ges a_rohkoeffkat_skal_merkel [aw=a_weight], cell


*** 13
bysort b_cdu_typ: tab b_skal_merkel_hd_ges b_rohkoeffkat_skal_merkel [aw=b_weight], cell

bysort b_spd_typ: tab b_skal_merkel_hd_ges b_rohkoeffkat_skal_merkel [aw=b_weight], cell

bysort b_gru_typ: tab b_skal_merkel_hd_ges b_rohkoeffkat_skal_merkel [aw=b_weight], cell



*Evaluation scale Steinmeier/Steinbrück
*** 09
bysort a_cdu_typ: tab a_skal_steinm_hd_ges a_rohkoeffkat_skal_steinm [aw=a_weight], cell

bysort a_spd_typ: tab a_skal_steinm_hd_ges a_rohkoeffkat_skal_steinm [aw=a_weight], cell

bysort a_gru_typ: tab a_skal_steinm_hd_ges a_rohkoeffkat_skal_steinm [aw=a_weight], cell


*** 13
bysort b_cdu_typ: tab b_skal_steinb_hd_ges b_rohkoeffkat_skal_steinb [aw=b_weight], cell

bysort b_spd_typ: tab b_skal_steinb_hd_ges b_rohkoeffkat_skal_steinb [aw=b_weight], cell

bysort b_gru_typ: tab b_skal_steinb_hd_ges b_rohkoeffkat_skal_steinb [aw=b_weight], cell



***Evaluation scale Trittin
*** 09
bysort a_cdu_typ: tab a_skal_trittin_hd_ges a_rohkoeffkat_skal_trittin [aw=a_weight], cell

bysort a_spd_typ: tab a_skal_trittin_hd_ges a_rohkoeffkat_skal_trittin [aw=a_weight], cell

bysort a_gru_typ: tab a_skal_trittin_hd_ges a_rohkoeffkat_skal_trittin [aw=a_weight], cell


*** 13
bysort b_cdu_typ: tab b_skal_trittin_hd_ges b_rohkoeffkat_skal_trittin [aw=b_weight], cell

bysort b_spd_typ: tab b_skal_trittin_hd_ges b_rohkoeffkat_skal_trittin [aw=b_weight], cell

bysort b_gru_typ: tab b_skal_trittin_hd_ges b_rohkoeffkat_skal_trittin [aw=b_weight], cell





save "${data}\data2009_2013 participants 7 waves.dta", replace
